
class Company(object):
    def __init__(self,employees:list):
        self.employees = employees

    # 实现了__getitem__ 就是一个 iterable 对象
    def __getitem__(self, item):
        return self.employees[item]

    def __len__(self):
        return len(self.employees)

    def __str__(self):
        return ",".join(self.employees)
    def __repr__(self):
        return ";".join(self.employees)
company = Company(["jack","rose","mike"])

# for emp in company:
#     print(emp)

# print(company[1])
# emps = company[:2]
# print(emps)

# print(len(company))
print(company)
company